package com.abe.abetest;

import android.view.View;

import com.abe.libbase.base.BaseActivity;
import com.abe.abetest.utils.CommonUtils;
import com.abe.abetest.widget.YaoView;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import butterknife.OnClick;

public class MethodTestActivity extends BaseActivity {
    @Override
    public int getLayoutRes() {
        return R.layout.activity_common;
    }

    @OnClick(R.id.item_btn)
    public void test(View view) {
        YaoView yaoView = new YaoView(this);
        yaoView.show();
    }

    @Override
    public void init() {
        time();
    }

    private void time() {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA);
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, -1); //向前走一天
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
       Date date = calendar.getTime();
        CommonUtils.wf("前一天时间为2:%s", dateFormat.format(date));
    }
}